import { Module } from "vuex";
import { ThemeConfigState, RootStateTypes } from "../interface";

const themeConfigModule: Module<ThemeConfigState, RootStateTypes> = {
    namespaced: true,
    state: {
        globalTitle: 'Hello Vue3_Vite2',
        isShowLogo: true,
        isCollapse: true,
        layout: 'defaults',
        menuBar: '#545c64',
        animation: 'slide-right',
        isFixedHeader: false,
        isBreadcrumb: true,
        isBreadcrumbIcon: true,
        isCacheTagsView: false
    },
    mutations: {
        getThemeConfig(state: any, data: object) {
            state.themeConfig = data;
        }
    },
    actions: {
        setThemeConfig({ commit }, data: object) {
            commit('getThemeConfig', data)
        }
    }
}

export default themeConfigModule;